import tool from '@/core/libs/tool.js';
import {
	marketsBTC,
	marketsETH,
	takerBuySellVolumeBTC,
	takerBuySellVolumeETH,
	newOptionsProfitLoss, // 期权对错利润
	newOptionsOpenCondition, //期权开市时间段
	newOptionsOpenTime,
	assetAmountSelect
} from '@/core/api/index.js';
import {
	customerInfo,
	assetList
} from '@/core/api/user.js';
export default {
	namespaced: true,
	state: {
		model: 'dark', //light dark-夜间 light-白昼
		// 交易所列表
		isContinue: true,
		BTCList: [],
		ETHList: [],
		// 多空比列表
		isContinue2: true,
		emptyTYpe: '5m',
		BTCList2: [],
		ETHList2: [],
		// BTC指数价格
		btcPrice: '',
		// 期权
		// optionType: '15m',
		// optionBTC: '',
		// optionETH: '',
		optionCoinType: '',
		optionPrice: '',
		optionPriceBTCUSDT: '',
		optionPriceETHUSDT: '',
		optionPriceGOLD: '',
		optionPriceUKOIL: '',
		optionPriceEURUSD: '',
		optionPriceGBPUSD: '',
		csnum: 1,
		// 用户信息
		vipClass: '', //vip等级
		vipEndTime: '', //vip到期时间
		passportAuthStatus: 0, //认证状态 0 未提交 1 审核中 2 审核失败 3 审核成功
		authName: '', 
		nickname: '', //昵称
		inviteCode: '', //邀请码
		avatarImg: '', //头像
		capitalPassword: false, //是否设置过密码
		faceId: '', //是否有人脸信息
		USDTMoney: {},
		BTCMoney: {},
		ETHMoney: {},
		newMessage: {},
		isChange: 0,
		profit1: '', //涨跌对
		profit2: '', //涨跌错
		profit3: '', //单双对
		profit4: '', //单双错
		openMarketTime: '', //期权开市 时间段
	},
	getters: {

	},
	mutations: {
		set_model(state, val) {
			state.model = val;
		},
		set_isContinue(state, val) {
			state.isContinue = val;
		},
		set_isContinue2(state, val) {
			state.isContinue2 = val;
		},
		set_emptyTYpe(state, val) {
			state.emptyTYpe = val;
		},
		// set_optionType(state, val) {
		// 	state.optionType = val;
		// },
		set_optionCoinType(state, val) {
			state.optionCoinType = val;
		},
		set_isChange(state, val) {
			state.isChange = val;
		},
		changeNewMessage(state, data) {
			// console.log(data, 'cs----------'+Object.keys(data)[0]);
			// state.optionPrice = 22222;
			if (data[state.optionCoinType]) {
				if (data[state.optionCoinType].price) {
					state.optionPrice = data[state.optionCoinType].price;
				}
			}
			if (data['BTCUSDT']) {
				if (data['BTCUSDT'].price) {
					state.optionPriceBTCUSDT = data['BTCUSDT'].price;
				}
			}
			if (data['ETHUSDT']) {
				if (data['ETHUSDT'].price) {
					state.optionPriceETHUSDT = data['ETHUSDT'].price;
				}
			}
			if (data['GOLD']) {
				if (data['GOLD'].price) {
					state.optionPriceGOLD = data['GOLD'].price;
				}
			}
			if (data['UKOIL']) {
				if (data['UKOIL'].price) {
					state.optionPriceUKOIL = data['UKOIL'].price;
				}
			}
			if (data['EURUSD']) {
				if (data['EURUSD'].price) {
					state.optionPriceEURUSD = data['EURUSD'].price;
				}
			}
			if (data['GBPUSD']) {
				if (data['GBPUSD'].price) {
					state.optionPriceGBPUSD = data['GBPUSD'].price;
				}
			}

			// if(Object.keys(data)[0].indexOf('takerBuySellVolume_BTC_')!=-1){
			// 	console.log(data, 'cs----------'+Object.keys(data)[0]);
			// }
			// uni.hideLoading();
			// return;
			// state.isChange = 1;
			if (data.pairs_markets_BTC) {

				// 现货交易所BTC
				let list1 = [];
				// for (let i = 0; i < data.pairs_markets_BTC.length; i++) {
				// 	data.pairs_markets_BTC[i].volUsd24h = (data.pairs_markets_BTC[i].volUsd24h / 100000000).toFixed(2);
				// 	data.pairs_markets_BTC[i].price = (data.pairs_markets_BTC[i].price / 1).toFixed(2);
				// 	data.pairs_markets_BTC[i].priceChangePercent24h = (data.pairs_markets_BTC[i].priceChangePercent24h /
				// 			1)
				// 		.toFixed(2);
				// 	if (data.pairs_markets_BTC[i].symbol.indexOf('USDT') != -1 || data.pairs_markets_BTC[i].exName ==
				// 		'Bitfinex') {
				// 		list1.push(data.pairs_markets_BTC[i]);
				// 	}
				// }
				for (let i = 0; i < data.pairs_markets_BTC.length; i++) {
					data.pairs_markets_BTC[i].exName = data.pairs_markets_BTC[i].exName.replace('.com', '');
					data.pairs_markets_BTC[i].volUsd24h = (data.pairs_markets_BTC[i].volUsd / 100000000).toFixed(2);
					data.pairs_markets_BTC[i].price = (data.pairs_markets_BTC[i].price / 1).toFixed(2);
					data.pairs_markets_BTC[i].priceChangePercent24h = (data.pairs_markets_BTC[i].priceChangePercent24h /
							1)
						.toFixed(2);
					list1.push(data.pairs_markets_BTC[i]);
				}

				state.BTCList = list1;
				// console.log(list1,'cs--cs1');
				// console.log(data.pairs_markets_BTC,'cs--cs2');
			}
			if (data.pairs_markets_ETH) {

				// 现货交易所ETH
				let list2 = [];
				for (let i = 0; i < data.pairs_markets_ETH.length; i++) {
					data.pairs_markets_ETH[i].exName = data.pairs_markets_ETH[i].exName.replace('.com', '');
					data.pairs_markets_ETH[i].volUsd24h = (data.pairs_markets_ETH[i].volUsd / 100000000).toFixed(2);
					data.pairs_markets_ETH[i].price = (data.pairs_markets_ETH[i].price / 1).toFixed(2);
					data.pairs_markets_ETH[i].priceChangePercent24h = (data.pairs_markets_ETH[i].priceChangePercent24h /
							1)
						.toFixed(2);
					list2.push(data.pairs_markets_ETH[i]);
				}
				state.ETHList = list2;
				// console.log(list2, 'cs--cs2');
			}
			// console.log(state.ETHList.length,state.BTCList.length, 'cs--cs1');
			if (state.ETHList.length != 0 && state.BTCList.length != 0) {
				uni.hideLoading();
			}
			// let arr = ['Binance', 'OKX', 'Bybit', 'Coinbase', 'Bitfinex', 'Kraken', 'Bitget'];
			// let arr = ['Binance', 'OKX', 'Bybit', 'Crypto.com', 'Bitfinex', 'Kraken', 'Bitget'];
			if (data['takerBuySellVolume_BTC_' + state.emptyTYpe]) {
				// console.log(data['takerBuySellVolume_BTC_' + state.emptyTYpe], 'cs--cs2');
				// 多空比交易所BTC
				let list3 = [];

				// for (let i = 0; i < data['takerBuySellVolume_BTC_' + state.emptyTYpe].length; i++) {
				// 	if (arr.indexOf(data['takerBuySellVolume_BTC_' + state.emptyTYpe][i].exchange) != -1) {
				// 		if (data['takerBuySellVolume_BTC_' + state.emptyTYpe][i].exchange == 'Bitget') {
				// 			data['takerBuySellVolume_BTC_' + state.emptyTYpe][i].exchange = 'Bitstamp';
				// 			list3[arr.indexOf('Bitget')] = data['takerBuySellVolume_BTC_' + state.emptyTYpe][i];
				// 		} else if (data['takerBuySellVolume_BTC_' + state.emptyTYpe][i].exchange == 'Crypto.com') {
				// 			data['takerBuySellVolume_BTC_' + state.emptyTYpe][i].exchange = 'Coinbase';
				// 			list3[arr.indexOf('Crypto.com')] = data['takerBuySellVolume_BTC_' + state.emptyTYpe][i];
				// 		} else {
				// 			list3[arr.indexOf(data['takerBuySellVolume_BTC_' + state.emptyTYpe][i].exchange)] = data[
				// 				'takerBuySellVolume_BTC_' + state.emptyTYpe][i];
				// 		}
				// 	}
				// }
				for (let i = 0; i < data['takerBuySellVolume_BTC_' + state.emptyTYpe].length; i++) {
					data['takerBuySellVolume_BTC_' + state.emptyTYpe][i].exchange = data['takerBuySellVolume_BTC_' +
						state.emptyTYpe][i].exchange.replace('.com', '');
					list3.push(data['takerBuySellVolume_BTC_' + state.emptyTYpe][i]);
				}
				state.BTCList2 = list3;
			}
			if (data['takerBuySellVolume_ETH_' + state.emptyTYpe]) {
				// 多空比交易所ETH
				// console.log(data['takerBuySellVolume_ETH_' + state.emptyTYpe],'cs--cs');
				let list4 = [];
				// for (let i = 0; i < data['takerBuySellVolume_ETH_' + state.emptyTYpe].length; i++) {
				// 	if (arr.indexOf(data['takerBuySellVolume_ETH_' + state.emptyTYpe][i].exchange) != -1) {
				// 		if (data['takerBuySellVolume_ETH_' + state.emptyTYpe][i].exchange == 'Bitget') {
				// 			data['takerBuySellVolume_ETH_' + state.emptyTYpe][i].exchange = 'Bitstamp';
				// 			list4[arr.indexOf('Bitget')] = data['takerBuySellVolume_ETH_' + state.emptyTYpe][i];
				// 		} else {
				// 			list4[arr.indexOf(data['takerBuySellVolume_ETH_' + state.emptyTYpe][i].exchange)] = data[
				// 				'takerBuySellVolume_ETH_' + state.emptyTYpe][i];
				// 		}
				// 	}
				// }
				for (let i = 0; i < data['takerBuySellVolume_ETH_' + state.emptyTYpe].length; i++) {
					data['takerBuySellVolume_ETH_' + state.emptyTYpe][i].exchange = data['takerBuySellVolume_ETH_' +
						state.emptyTYpe][i].exchange.replace('.com', '');
					list4.push(data['takerBuySellVolume_ETH_' + state.emptyTYpe][i])
				}
				state.ETHList2 = list4;
			}
			if (data.BTC_USDT_PRICE) {
				// btc 指数
				state.btcPrice = data.BTC_USDT_PRICE;
			}

			// if (data['optionsMarkets_BTC_' + state.optionType]) {
			// 	// console.log(data['optionsMarkets_BTC_' + state.optionType],'cs----cs3')
			// 	// 期权BTC
			// 	state.optionBTC = data['optionsMarkets_BTC_' + state.optionType];
			// }
			// if (data['optionsMarkets_ETH_' + state.optionType]) {
			// 	// 期权ETH
			// 	state.optionETH = data['optionsMarkets_ETH_' + state.optionType];
			// }
		}
	},
	actions: {
		getAassetList({
			state
		}) {
			assetAmountSelect({
				coinType: 'BTC',
				mobileUserId: uni.getStorageSync('mobileUserId'),
				startDate: '2022-03-04',
				endDate: '2022-03-05',
			}).then(res => {
				let obj = res.result;
				state.BTCMoney.b = Number(obj.day1AssetRate);
				state.BTCMoney.s = Number(obj.day1AssetData);
				state.BTCMoney = JSON.parse(JSON.stringify(state.BTCMoney));
			})
			assetAmountSelect({
				coinType: 'USDT',
				mobileUserId: uni.getStorageSync('mobileUserId'),
				startDate: '2022-03-04',
				endDate: '2022-03-05',
			}).then(res => {
				let obj = res.result;
				state.USDTMoney.b = Number(obj.day1AssetRate);
				state.USDTMoney.s = Number(obj.day1AssetData);
				state.USDTMoney = JSON.parse(JSON.stringify(state.USDTMoney));
			})
			assetAmountSelect({
				coinType: 'ETH',
				mobileUserId: uni.getStorageSync('mobileUserId'),
				startDate: '2022-03-04',
				endDate: '2022-03-05',
			}).then(res => {
				let obj = res.result;
				state.ETHMoney.b = Number(obj.day1AssetRate);
				state.ETHMoney.s = Number(obj.day1AssetData);
				state.ETHMoney = JSON.parse(JSON.stringify(state.ETHMoney));
			})
			assetList({
				mobileUserId: uni.getStorageSync('mobileUserId'),
			}).then(res => {
				console.log(res, (58641.1903 * 1000 + 30000 * 1000) / 1000, 'cs------------csassetList');
				let list = res.result.assetList;
				for (let i = 0; i < list.length; i++) {
					if (list[i].coinType == 'BTC') {
						state.BTCMoney.a = list[i].availableAmount ? list[i].availableAmount : 0; //可用
						state.BTCMoney.o = list[i].occupyAmount ? list[i].occupyAmount : 0; //占用
						state.BTCMoney.t = list[i].totalAmount ? list[i].totalAmount : 0; //折合
						state.BTCMoney.z = (Number(list[i].availableAmount) * 1000000 + Number(list[i]
								.occupyAmount) *
							1000000) / 1000000; // 总的
						// state.BTCMoney.s = list[i].todayProfitAmount ? list[i].todayProfitAmount : 0; //收益
						// state.BTCMoney.b = list[i].todayProfitPercent ? list[i].todayProfitPercent : 0; //百分比
						state.BTCMoney.kh = list[i].transferableAmount ? list[i].transferableAmount : 0; // 可划转
						state.BTCMoney.kt = (Number(list[i].transferableAmount) * 1000000 - Number(list[i]
								.transferOutHistoryAmount) *
							1000000) / 1000000; // 可提现
						state.BTCMoney = JSON.parse(JSON.stringify(state.BTCMoney));
					}
					if (list[i].coinType == 'ETH') {
						state.ETHMoney.a = list[i].availableAmount ? list[i].availableAmount : 0; //可用
						state.ETHMoney.o = list[i].occupyAmount ? list[i].occupyAmount : 0; //占用
						state.ETHMoney.t = list[i].totalAmount ? list[i].totalAmount : 0; //折合
						state.ETHMoney.z = (Number(list[i].availableAmount) * 1000000 + Number(list[i]
								.occupyAmount) *
							1000000) / 1000000; // 总的
						// state.ETHMoney.s: list[i].todayProfitAmount ? list[i].todayProfitAmount : 0, //收益
						// state.ETHMoney.b: list[i].todayProfitPercent ? list[i].todayProfitPercent : 0, //百分比
						state.ETHMoney.kh = list[i].transferableAmount ? list[i].transferableAmount : 0; // 可划转
						state.ETHMoney.kt = (Number(list[i].transferableAmount) * 1000000 - Number(list[i]
								.transferOutHistoryAmount) *
							1000000) / 1000000; // 可提现
						state.ETHMoney = JSON.parse(JSON.stringify(state.ETHMoney));

					}
					if (list[i].coinType == 'USDT') {
						state.USDTMoney.a = list[i].availableAmount ? list[i].availableAmount : 0; //可用
						state.USDTMoney.o = list[i].occupyAmount ? list[i].occupyAmount : 0; //占用
						state.USDTMoney.t = list[i].totalAmount ? list[i].totalAmount : 0; //折合
						state.USDTMoney.z = (Number(list[i].availableAmount) * 1000000 + Number(list[i]
								.occupyAmount) *
							1000000) / 1000000; // 总的
						// state.USDTMoney.s: list[i].todayProfitAmount ? list[i].todayProfitAmount : 0, //收益
						// state.USDTMoney.b: list[i].todayProfitPercent ? list[i].todayProfitPercent : 0, //百分比
						state.USDTMoney.kh = list[i].transferableAmount ? list[i].transferableAmount : 0; // 可划转
						state.USDTMoney.kt = (Number(list[i].transferableAmount) * 1000000 - Number(list[i]
								.transferOutHistoryAmount) *
							1000000) / 1000000; // 可提现
						state.USDTMoney = JSON.parse(JSON.stringify(state.USDTMoney));
					}
				}
			})
		},
		getCustomerInfo({
			state
		}) {
			customerInfo({
				mobileUserId: uni.getStorageSync('mobileUserId'), //客户id
			}).then(res => {

				let obj = res.result.mobileUser;
				// vip等级
				state.vipClass = obj.membershipLevel ? obj.membershipLevel : 'VIP0';
				// vip 到期时间
				state.vipEndTime = obj.membershipExpiryDate ? obj.membershipExpiryDate : '永久有效';
				// 认证状态
				// state.passportAuthStatus = obj.passportAuthStatus == null ? 0 :
				// 	obj.passportAuthStatus == 'Apply' ? 1 :
				// 	obj.passportAuthStatus == 'No_Pass' ? 2 :
				// 	obj.passportAuthStatus == 'Pass' ? 3 : '';
				// 认证状态
				if (obj.passportAuthStatus == 'Pass' || obj.cardAuthStatus == 'Pass') {
					state.passportAuthStatus = 3;
					state.authName = obj.authName
				} else {
					state.passportAuthStatus = obj.passportAuthStatus == null && obj.cardAuthStatus == null  ? 0 :
						obj.passportAuthStatus == 'Apply' || obj.cardAuthStatus == 'Apply'? 1 :
						obj.passportAuthStatus == 'No_Pass' || obj.cardAuthStatus == 'No_Pass'? 2 :
						obj.passportAuthStatus == 'Pass' || obj.cardAuthStatus == 'Pass'? 3 : '';
				}
				// 昵称
				state.nickname = obj.nickname ? obj.nickname : '';
				state.inviteCode = obj.inviteCode;
				state.avatarImg = obj.avatarImg ? obj.avatarImg : '';
				state.capitalPassword = obj.capitalPassword ? true : false;
				state.faceId = obj.faceId ? obj.faceId : '';
			})
		},
		getExchangeListBTC({
			state,
			dispatch
		}) {
			// marketsBTC().then(res => {
			// 	// state.csnum++;

			// 	let list = [];
			// 	for (let i = 0; i < res.result.length; i++) {
			// 		res.result[i].volUsd24h = (res.result[i].volUsd24h / 100000000).toFixed(2);
			// 		res.result[i].price = (res.result[i].price / 1).toFixed(2);
			// 		res.result[i].priceChangePercent24h = (res.result[i].priceChangePercent24h / 1).toFixed(2);
			// 		if(res.result[i].symbol.indexOf('USDT')!=-1||res.result[i].exName=='Bitfinex'){
			// 			list.push(res.result[i]);
			// 		}
			// 	}
			// 	state.BTCList = list;
			// 	if (state.ETHList.length != 0) {
			// 		uni.hideLoading();
			// 	}
			// 	if (state.isContinue) {
			// 		setTimeout(e => {
			// 			// dispatch('getExchangeListBTC');
			// 		}, 1000)
			// 	}
			// }).catch(err => {
			// 	if (state.isContinue) {
			// 		setTimeout(e => {
			// 			// dispatch('getExchangeListBTC');
			// 		}, 1000)
			// 	}
			// })
		},
		getExchangeListETH({
			state,
			dispatch
		}) {
			// marketsETH().then(res => {
			// 	let list = [];
			// 	for (let i = 0; i < res.result.length; i++) {
			// 		res.result[i].volUsd24h = (res.result[i].volUsd24h / 100000000).toFixed(2);
			// 		res.result[i].price = (res.result[i].price / 1).toFixed(2);
			// 		res.result[i].priceChangePercent24h = (res.result[i].priceChangePercent24h / 1).toFixed(2);
			// 		if(res.result[i].symbol.indexOf('USDT')!=-1||res.result[i].exName=='Bitfinex'){
			// 			list.push(res.result[i]);
			// 		}
			// 	}
			// 	state.ETHList = list;
			// 	if (state.BTCList.length != 0) {
			// 		uni.hideLoading();
			// 	}
			// 	if (state.isContinue) {
			// 		setTimeout(e => {
			// 			// dispatch('getExchangeListETH');
			// 		}, 1000)

			// 	}
			// }).catch(err => {
			// 	if (state.isContinue) {
			// 		setTimeout(e => {
			// 			// dispatch('getExchangeListETH');
			// 		}, 1000)
			// 	}
			// })
		},
		getTakerBuySellVolumeBTC({
			state,
			dispatch
		}, timeName) {
			console.log(timeName, 'cscs');
			// takerBuySellVolumeBTC({
			// 	range: timeName
			// }).then(res => {
			// 	console.log(res, 'cs------------------------------assetList');
			// 	let arr = ['Binance','OKX','Bybit','Coinbase','Bitfinex','Kraken','Bitget'];
			// 	let list = [];
			// 	for(let i=0;i<res.result.length;i++){
			// 		if(arr.indexOf(res.result[i].exchange)!=-1){
			// 			if(res.result[i].exchange=='Bitget'){
			// 				res.result[i].exchange = 'Bitstamp';
			// 				list[arr.indexOf('Bitget')] = res.result[i];
			// 			}else{
			// 				list[arr.indexOf(res.result[i].exchange)] = res.result[i];
			// 			}
			// 		}
			// 	}
			// 	state.BTCList2 = list;
			// 	if (state.isContinue2) {
			// 		setTimeout(e => {
			// 			// dispatch('getTakerBuySellVolumeBTC', timeName);
			// 		}, 1000)
			// 	}
			// }).catch(err => {
			// 	if (state.isContinue2) {
			// 		setTimeout(e => {
			// 			// dispatch('getTakerBuySellVolumeBTC', timeName);
			// 		}, 1000)
			// 	}
			// })
		},

		getTakerBuySellVolumeETH({
			state,
			dispatch
		}, timeName) {
			// takerBuySellVolumeETH({
			// 	range: timeName
			// }).then(res => {
			// 	let arr = ['Binance','OKX','Bybit','Coinbase','Bitfinex','Kraken','Bitget'];
			// 	let list = [];
			// 	for(let i=0;i<res.result.length;i++){
			// 		if(arr.indexOf(res.result[i].exchange)!=-1){
			// 			if(res.result[i].exchange=='Bitget'){
			// 				res.result[i].exchange = 'Bitstamp';
			// 				list[arr.indexOf('Bitget')] = res.result[i];
			// 			}else{
			// 				list[arr.indexOf(res.result[i].exchange)] = res.result[i];
			// 			}
			// 		}
			// 	}
			// 	state.ETHList2 = list;
			// 	if (state.isContinue2) {
			// 		setTimeout(e => {
			// 			// dispatch('getTakerBuySellVolumeETH', timeName);
			// 		}, 1000)

			// 	}
			// }).catch(err => {
			// 	if (state.isContinue2) {
			// 		setTimeout(e => {
			// 			// dispatch('getTakerBuySellVolumeETH', timeName);
			// 		}, 1000)
			// 	}
			// })
		},
		getNewOptionsProfitLoss({
			state,
			dispatch
		}) {
			newOptionsProfitLoss().then(res => {
				let list = res.result;
				for (let i = 0; i < list.length; i++) {
					if (list[i].value == 'bull_profit') {
						state.profit1 = list[i].title
					}
					if (list[i].value == 'bull_loss') {
						state.profit2 = list[i].title
					}
					if (list[i].value == 'single_profit') {
						state.profit3 = list[i].title
					}
					if (list[i].value == 'single_loss') {
						state.profit4 = list[i].title
					}
				}
				// state.
			}).catch(err => {

			})
		},
		getNewOptionsOpenCondition({
			state,
			dispatch
		}) {
			newOptionsOpenTime().then(res => {
				console.log(res.result);
				let obj = {};
				for (let i = 0; i < res.result.length; i++) {
					let dictModelList = JSON.parse(JSON.stringify(res.result[i].dictModelList));
					// 升序排序
					dictModelList.sort((a, b) => a.label - b.label);
					// console.log(dictModelList,'===========开市时间=========1');
					let weekOneArr = [
						[],
						[],
						[],
						[],
						[],
						[],
						[]
					];
					for (let j = 0; j < dictModelList.length; j++) {
						if (dictModelList[j].label == '0') {
							weekOneArr[0].push({
								s: dictModelList[j].value.split('-')[0],
								e: dictModelList[j].value.split('-')[1],
							})
						}
						if (dictModelList[j].label == '1') {
							weekOneArr[1].push({
								s: dictModelList[j].value.split('-')[0],
								e: dictModelList[j].value.split('-')[1],
							})
						}
						if (dictModelList[j].label == '2') {
							weekOneArr[2].push({
								s: dictModelList[j].value.split('-')[0],
								e: dictModelList[j].value.split('-')[1],
							})
						}
						if (dictModelList[j].label == '3') {
							weekOneArr[3].push({
								s: dictModelList[j].value.split('-')[0],
								e: dictModelList[j].value.split('-')[1],
							})
						}
						if (dictModelList[j].label == '4') {
							weekOneArr[4].push({
								s: dictModelList[j].value.split('-')[0],
								e: dictModelList[j].value.split('-')[1],
							})
						}
						if (dictModelList[j].label == '5') {
							weekOneArr[5].push({
								s: dictModelList[j].value.split('-')[0],
								e: dictModelList[j].value.split('-')[1],
							})
						}
						if (dictModelList[j].label == '6') {
							weekOneArr[6].push({
								s: dictModelList[j].value.split('-')[0],
								e: dictModelList[j].value.split('-')[1],
							})
						}
					}
					// console.log(weekOneArr,'===========开市时间=========2');
					let arrGroupNum = 0;
					for (let j = 0; j < weekOneArr.length; j++) {
						if (weekOneArr[j].length > arrGroupNum) {
							arrGroupNum = weekOneArr[j].length;
						}
					}
					// console.log(arrGroupNum,'===========开市时间=========3');
					let arr = [];
					for (let j = 0; j < arrGroupNum; j++) {
						arr.push([{}, {}, {}, {}, {}, {}, {}])
					}
					for (let j = 0; j < arr.length; j++) {
						for (let k = 0; k < arr[j].length; k++) {
							if (weekOneArr[k][j]) {
								arr[j][k] = weekOneArr[k][j]
							}
						}
					}
					obj[res.result[i].coinType] = arr;
				}
				console.log(obj, '===========开市时间=========5');
				state.openMarketTime = obj;
				// for(let i=0;i<res.result.length;i++){
				// 	if(res.result[i].title=='开市中'){
				// 		state.openMarketTime = res.result[i].value;
				// 		// state.openMarketTime = '9:30-11:00';
				// 	}
				// }
			}).catch(err => {

			})
		},
	},
}